/************************************************************************
 run.cpp - Copyright Costiou, Yven, UBO
 *************************************************************************
 Steven Costiou
 Julien Yven
 Master 2 Systemes complexes
 Universite de Bretagne Occidentale (UBO)
 *************************************************************************
 Brest, 2008
 **************************************************************************/

#include <iostream>
#include <string>
#include <vector>
#include <map>

#include "Engine.h"
#include "GameEngine.h"
#include "Scheduler.h"
#include "Agent.h"
#include "Basic2DGraphicAgent.h"
#include "SDLTestAgent.h"

#include "CORE_TYPES_AND_DEFINITIONS.h"
#include "TRACE_INTERFACE.h"

#define DEBUG_MODE true

#define NBAGENTS 9
#define FORMODE 1

using namespace std;

int main(int argc, char ** argv)
{
	TRC_EVT(log4cpp::Priority::INFO, "Initializing system 2");
	GameEngine* localEngine = new GameEngine(PRIORITY_SCHEDULER);
	cout << endl << "***********************" << endl << "Game Engine created"
			<< endl << "***********************" << endl << endl;

	srand(time(0));

	/// Standard creation
	cout << "Creating agents..." << endl;
	for (int i = 0; i < 100; i++)
	{
	//	localEngine->createAgentWithPriority(new DWGraphicAgent(localEngine), MEDIUM_PRIORITY);
	}

	cout << "Lauching system..." << endl;

	cout << endl << "NO FAILURES, SYSTEM IS CLEAR TO LAUNCH" << endl << endl;

	localEngine->startSytem();
	localEngine->workUntilSystemBreakDown();
	TRC_EVT(log4cpp::Priority::INFO, "Ending system");

	log4cpp::Category::shutdown();

	//CLEAN_TRC_OBJECTS;
}

